package cn.cdeden.knowledge.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @ProjectName : ecm_svn02
 * @Package : com.cdyd.ecm.notice.message.util.enums
 * @ClassName : MessageEnums
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2023/11/28 17:30
 * @Version : 1.0
 */
@Getter
//@AllArgsConstructor
public enum MessageFileTypeEnums {

    FILE("file", "文件库"),

    ENTERPRISE("enterprise", "企业库"),

    TEAM("team", "团队库"),

    DISTRIBUTE("distribute", "分发文档"),

    KOWN("kown", "知乎"),

    ANNOUNCEMENT("announcement", "公告"),

    TASK("task", "任务"),


    SYNERGY("synergy", "协同编辑"),

    FILE_SHARE("file_share", "文件分享"),

    //    项目
    PROJECT("project", "项目"),

    //    培训
    TRAINING("training", "培训"),

    //    日历
    CALENDAR("calendar", "日历"),

    //    合同
    CONTRACT("contract", "合同"),
    ;

    MessageFileTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

//    MessageTypeEnums(String code, String name, String fileType, String type) {
//        this.code = code;
//        this.name = name;
//        this.fileType = fileType;
//        this.type = type;
//    }

    private final String code;
    private final String name;
//    private final String fileType;
//    private final String type;

    public static MessageFileTypeEnums find(String type) {
        for (MessageFileTypeEnums value : MessageFileTypeEnums.values()) {
            if (StringUtils.equalsIgnoreCase(type, value.getCode())) {
                return value;
            }
        }
        return null;
    }


}
